package com.hyts.threads.handler;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author libo
 * @description 自定义扩展线程池执行操作句柄
 * @date 2017-07-10
 */
public class ThreadPoolExecuteHandler implements RejectedExecutionHandler {

	/* (non-Javadoc)
	 * @see java.util.concurrent.RejectedExecutionHandler#rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor)
	 */
	@Override
	public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
		System.out.println("已进入线程池执行句柄捕捉类中");
		executor.getQueue().offer(r);
		System.out.println("已离开想城池执行句柄捕捉类外");
	}

}
